<?php 

// 判断是否加载库
// echo extension_loaded("GD");
// 

header("Content-type: image/png");
// 创建画布
$src = imageCreateTrueColor(200,100); 
//根据画布选择颜色
$color = imageColorAllocate($src,255,255,255); 
// 填充
imageFill($src,0,0,$color);



// imagerectangle ( $src , 0 , 0 , 100 , 50, $color );
// imagefilledrectangle ( $src , 0 , 0 , 100 , 50, $color );

// imageellipse ( $src ,100,50, 100 , 50 ,$color);
// imagefilledellipse ( $src ,100,50, 100 , 50 ,$color);

// imageline ( $src , 0 , 0 , 100 , 50, $color);

// 
$color = imageColorAllocate($src,mt_rand(0,255),mt_rand(0,255),mt_rand(0,250));

// FireBlock.ttf
// 
// 


for ($i=0; $i < 4; $i++) { 
	$str = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890";
	$code = $str[mt_rand(0,strlen($str)-1)];

	$width = $i*45;

	$width+=10;

	$height = mt_rand(70,80);

	$color = imageColorAllocate($src,mt_rand(0,255),mt_rand(0,255),mt_rand(0,250));
	imagettftext ($src, 50 , mt_rand(-15,15) ,$width ,$height,$color, './FireBlock.ttf' , $code);
}

for ($i=0; $i < 1000; $i++) { 
	$color = imageColorAllocate($src,mt_rand(0,200),mt_rand(0,200),mt_rand(0,200));
	imagesetpixel ( $src , mt_rand(0,200) , mt_rand(0,100), $color);
}

for ($i=0; $i <20 ; $i++) { 
	$color = imageColorAllocate($src,mt_rand(0,200),mt_rand(0,200),mt_rand(0,200));

	imageline ( $src , mt_rand(0,200) , mt_rand(0,50) , mt_rand(0,200) , mt_rand(50,100), $color);
}


imagepng($src); 

imageDestroy($src);  

?>










